Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: heavy sketch file #2992

Merged
merged 1 commit into from
May 10, 2024
Merged

fix: heavy sketch file #2992

merged 1 commit into from
May 10, 2024

Conversation

saleniuk
Copy link
Contributor


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Issues

Sketch can take up even a multiple megabytes, but shouldn't.

Causes (Optional)

We have a single file image_attachment for keeping all temporary images that are about to be uploaded and sent.
When we take a photo, this file is cleared completely but when we create a sketch, we write to that file but not clear it first. This makes it so that the file's metadata can still have the size of the previous sent image, for instance photo that user took to send.

Solutions

Use rwt mode instead of rw when opening file descriptor to write sketch paths to this temporary file, this way it will be truncated before creating a new sketch.

Testing

How to Test

Take a big photo to send and then send a sketch - check how big is this sketch file.


PR Post Submission Checklist for internal contributors (Optional)

  • Wire's Github Workflow has automatically linked the PR to a JIRA issue

PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

References
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

@saleniuk saleniuk requested review from yamilmedina, a team, typfel, borichellow, mchenani, ohassine and Garzas and removed request for a team May 10, 2024 07:04
Copy link
Contributor

@Garzas Garzas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😎

Copy link
Contributor

Test Results

927 tests   927 ✅  8m 5s ⏱️
123 suites    0 💤
123 files      0 ❌

Results for commit d607153.

Copy link
Contributor

APKs built during tests are available here. Scroll down to Artifacts!

@saleniuk saleniuk merged commit faad623 into release/candidate May 10, 2024
12 of 13 checks passed
@saleniuk saleniuk deleted the fix/heavy-sketch-file branch May 10, 2024 07:38
github-actions bot pushed a commit that referenced this pull request May 10, 2024
@github-actions github-actions bot mentioned this pull request May 10, 2024
6 tasks
@AndroidBob
Copy link
Collaborator

Build 4694 succeeded.

The build produced the following APK's:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants